|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jhotdraw.beans.AbstractBean
org.jhotdraw.app.AbstractApplication
org.jhotdraw.app.DefaultMDIApplication
public class DefaultMDIApplication
DefaultMDIApplication handles the lifecycle of Views using a
multiple document interface (MDI).
An application consists of a parent JFrame which holds a JDesktopPane.
The views reside in JInternalFrames inside of the JDesktopPane.
The parent frame also contains a menu bar, toolbars and palette windows for
the views.
The life cycle of the application is tied to the parent JFrame.
Closing the parent JFrame quits the application.
The parent frame has the following standard menus:
File Edit Window HelpThe file menu has the following standard menu items:
New (The edit menu has the following standard menu items:NewAction.ID}) Open... (OpenAction.ID}) Open Recent > "Filename" (OpenRecentAction.ID}) - Close (CloseAction.ID) Save (SaveAction.ID) Save As... (SaveAsAction.ID) - Print... (PrintAction.ID) - Exit (ExitAction.ID)
Settings (AbstractPreferencesAction.ID)
The window menu has the following standard menu items:
Minimize (The help menu has the following standard menu items:MinimizeAction.ID) Maximize (MaximizeAction.ID) - "Filename" (FocusAction.ID)
About (AboutAction.ID)
The menus provided by the ApplicationModel are inserted between
the file menu and the window menu. In case the application model supplies
a menu with the title "Edit" or "Help", the standard menu items are added
with a seperator to the end of the menu.
| Nested Class Summary | |
|---|---|
private class |
DefaultMDIApplication.OpenRecentMenuHandler
Updates the menu items in the "Open Recent" file menu. |
private class |
DefaultMDIApplication.WindowMenuHandler
Updates the menu items in the "Open Recent" file menu. |
| Field Summary | |
|---|---|
private MDIDesktopPane |
desktopPane
|
private javax.swing.JFrame |
parentFrame
|
private java.util.prefs.Preferences |
prefs
|
private javax.swing.JScrollPane |
scrollPane
|
private java.util.LinkedList<javax.swing.Action> |
toolBarActions
|
| Fields inherited from class org.jhotdraw.app.AbstractApplication |
|---|
labels, VIEW_COUNT_PROPERTY |
| Fields inherited from class org.jhotdraw.beans.AbstractBean |
|---|
propertySupport |
| Fields inherited from interface org.jhotdraw.app.Application |
|---|
ACTIVE_VIEW_PROPERTY |
| Constructor Summary | |
|---|---|
DefaultMDIApplication()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
configure(java.lang.String[] args)
Configures the application using the provided arguments array. |
protected javax.swing.JMenu |
createEditMenu()
|
protected javax.swing.JMenu |
createFileMenu()
|
protected javax.swing.JMenu |
createHelpMenu()
|
protected javax.swing.JMenuBar |
createMenuBar()
Creates a menu bar. |
protected javax.swing.JMenu |
createWindowMenu()
|
java.awt.Component |
getComponent()
Returns the application component. |
void |
hide(View p)
Hides a view. |
void |
init()
Initializes the application. |
protected void |
initApplicationActions()
|
protected void |
initLookAndFeel()
|
protected void |
initViewActions(View p)
|
boolean |
isSharingToolsAmongViews()
Returns true, if this application shares tools among multiple views. |
void |
launch(java.lang.String[] args)
Launches the application from the main method. |
void |
show(View p)
Shows a view. |
protected void |
updateViewTitle(View v,
javax.swing.JInternalFrame f)
Updates the title of a view and displays it in the given frame. |
protected java.awt.Component |
wrapDesktopPane(java.awt.Component c,
java.util.LinkedList<javax.swing.Action> toolBarActions)
Returns the wrapped desktop pane. |
| Methods inherited from class org.jhotdraw.app.AbstractApplication |
|---|
add, addPalette, addRecentFile, addWindow, basicCreateView, clearRecentFiles, createContainer, createView, dispose, getActiveView, getCopyright, getModel, getName, getVersion, initLabels, isEnabled, recentFiles, remove, removePalette, removeWindow, setActiveView, setEnabled, setModel, start, stop, views |
| Methods inherited from class org.jhotdraw.beans.AbstractBean |
|---|
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jhotdraw.app.Application |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
|---|
private javax.swing.JFrame parentFrame
private javax.swing.JScrollPane scrollPane
private MDIDesktopPane desktopPane
private java.util.prefs.Preferences prefs
private java.util.LinkedList<javax.swing.Action> toolBarActions
| Constructor Detail |
|---|
public DefaultMDIApplication()
| Method Detail |
|---|
protected void initApplicationActions()
protected void initViewActions(View p)
initViewActions in class AbstractApplicationpublic void launch(java.lang.String[] args)
Application
launch in interface Applicationlaunch in class AbstractApplicationpublic void init()
Applicationconfigure() should have been invoked before the application
is inited. Alternatively an application can be configured using setter
methods.
init in interface Applicationinit in class AbstractApplicationpublic void configure(java.lang.String[] args)
Application
configure in interface Applicationconfigure in class AbstractApplicationprotected void initLookAndFeel()
public void show(View p)
Application
public void hide(View p)
Application
public boolean isSharingToolsAmongViews()
Application
public java.awt.Component getComponent()
Application
protected java.awt.Component wrapDesktopPane(java.awt.Component c,
java.util.LinkedList<javax.swing.Action> toolBarActions)
protected javax.swing.JMenuBar createMenuBar()
protected javax.swing.JMenu createFileMenu()
protected void updateViewTitle(View v,
javax.swing.JInternalFrame f)
v - The view.f - The frame.protected javax.swing.JMenu createWindowMenu()
protected javax.swing.JMenu createEditMenu()
protected javax.swing.JMenu createHelpMenu()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||